﻿Imports Mysoft.Map.Data

Partial Public Class Cwjk_PzRuleSet_OperType_Grid
    Inherits Mysoft.Map.Application.Security.AppPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim strCwztGUID, strIsAll, strApplication, IsPos As String
            Dim strCustomFilter As String = ""
            strCwztGUID = Request.QueryString("CwztGUID")
            strIsAll = Request.QueryString("IsAll")
            strApplication = Request.QueryString("Application")
            If Not strCwztGUID Is Nothing AndAlso strCwztGUID <> "" Then
                If strApplication = "0101" Then
                    IsPos = MyDB.GetDataItemString("select IsPos from p_CwjkCwzt where CwztGUID = '" & strCwztGUID & "'")
                End If

                strCustomFilter = " CwztGUID = '" & strCwztGUID & "'"
                If Not strIsAll Is Nothing AndAlso strIsAll = "0" Then
                    strCustomFilter &= " AND IsDisable = 0 "
                Else
                    '显示所有时，如果账套的"是否存在POS费用"为"收款时有POS机手续费"，则不显示“批量POS机费用支付”业务场景
                    '不能使用业务场景名称来判断，因为业务场景允许更改
                    If strApplication = "0101" AndAlso IsPos = "True" Then
                        strCustomFilter &= " AND HierarchyCode <> '006.002' "
                    End If
                End If
            Else
                strCustomFilter = " 1=2 "
            End If
            appGridTree.CustomFilter = strCustomFilter
        End If
    End Sub

End Class